package org.jix.gbook.auth.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

import java.util.Objects;

/**
 * @author stark
 * @date 2025/5/15 7:56
 * @description
 **/
@Getter
@AllArgsConstructor
public enum LoginTypeEnum {

    //验证码
    VERIFICATION_CODE(1),
    //密码
    PASSWORD(2);
    private final Integer value;

    public static LoginTypeEnum valueOf(Integer code) {
        for (LoginTypeEnum loginTypeEnum : LoginTypeEnum.values()) {
            if (Objects.equals(code, loginTypeEnum.getValue())) {
                return loginTypeEnum;
            }
        }
        return null;
    }
}
